package com.chaihu.admin.api;

import com.alibaba.fastjson.JSON;
import com.chaihu.bean.in.admin.menu.QueryMenusIn;
import com.chaihu.bean.out.admin.menu.QueryMenusOut;
import com.chaihu.bean.result.ResponseResult;
import com.chaihu.intf.admin.menu.QueryMenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestApi {

    @Autowired
    private QueryMenusService queryMenusService;

    @RequestMapping(value = "/tt", method = RequestMethod.GET)
    public ResponseEntity<Object> get() {
        QueryMenusIn queryMenusIn = new QueryMenusIn();
        queryMenusIn.setDomain("800900000000");
        queryMenusIn.setUserId("123123");
        ResponseResult<List<QueryMenusOut>> queryMenusOutResponseResult = queryMenusService.queryMenus(queryMenusIn);
        System.out.println(JSON.toJSONString(queryMenusOutResponseResult));
        return new ResponseEntity<Object>(queryMenusOutResponseResult, HttpStatus.OK);
    }
}
